package com.itheima.cncom;

import java.io.IOException;
import java.net.*;
import java.util.Scanner;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        DatagramSocket datagramSocket = new DatagramSocket();
        while (true) {
            String str =sc.nextLine();
            if("886".equals(str)){
                break;
            }
            byte[] bytes = str.getBytes();
            InetAddress byName = InetAddress.getByName("127.0.0.1");
            int port = 10024;
            DatagramPacket datagramPacket = new DatagramPacket(bytes,bytes.length,byName,port);
            datagramSocket.send(datagramPacket);
        }
        datagramSocket.close();
    }
}
